import { request } from "./utils";

export function getHotelRoleByPage(query) {
  return request({
    url: "/hotel/role/page",
    method: "get",
    params: query
  });
}

export function getHotelRoleListAll() {
  return request({
    url: "/hotel/role/listAll",
    method: "get"
  });
}
export function getRoleIdsByUserId(userId) {
  return request({
    url: "/hotel/role/getRoleIdsByUserId/" + userId,
    method: "get"
  });
}
export function getRoleIdsByRoleId(roleId) {
  return request({
    url: "/hotel/role/getRoleById/" + roleId,
    method: "get"
  });
}

export function switchHotelRoleStatus(data) {
  return request({
    url: "/hotel/role/switchStatus",
    method: "put",
    data: data
  });
}
export function updateHotelRole(data) {
  return request({
    url: "/hotel/role/edit",
    method: "put",
    data: data
  });
}
export function setHotelRoleAuths(data) {
  return request({
    url: "/hotel/role/setAuths",
    method: "put",
    data: data
  });
}

export function addHotelRole(data) {
  return request({
    url: "/hotel/role/add",
    method: "post",
    data: data
  });
}
export function deleteHotelRole(roleId) {
  return request({
    url: "/hotel/role/delete/" + roleId,
    method: "delete"
  });
}
